package com.example.onlinemusic.controller;

import com.example.onlinemusic.common.R;
import com.example.onlinemusic.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 收藏控制类
 */
@RestController
public class CollectController {
    @Autowired
    CollectService collectService;

    /**
     * 根据用户ID查询该用户收藏的歌曲
     * @param userId
     * @return
     */
    @GetMapping("/collection/detail")
    public R collectOfUser(@RequestParam int userId){
        return collectService.collectOfUser(userId);

    }

}
